home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9189 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: darkstar.UCSC.EDU!usenet
  2. From: "Chuck L. Peterson" <clp@alumni.cse.ucsc.edu>
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++,comp.graphics.api.opengl
  4. Subject: MfcOgl to get multiple OpenGL contexts
  5. Date: Wed, 28 Feb 1996 22:36:46 -0800
  6. Organization: Multi-Trek Control Center
  7. Message-ID: <3135497E.2AE@alumni.cse.ucsc.edu>
  8. NNTP-Posting-Host: 204.160.104.18
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. I've been using the CMfcOglView class provided with the
  15. Microsoft MFCOGL with great success.
  16.  
  17. But now I want to create 2 or 3 OpenGL context regions
  18. all within the same Window. How would I go about doing this?
  19.  
  20. This routine goes right into setting up the OpenGL context
  21. without even giving me a chance to specify/setup other windows:
  22.  
  23. void CMfcOglView::Init()
  24. {
  25.     PIXELFORMATDESCRIPTOR pfd;
  26.     int         n;
  27.     HGLRC        hrc;
  28.     m_pDC = new CClientDC(this);
  29.     if (!bSetupPixelFormat())
  30.         return;
  31.     n = ::GetPixelFormat(m_pDC->GetSafeHdc());
  32.     ::DescribePixelFormat(m_pDC->GetSafeHdc(), n, sizeof(pfd), &pfd);
  33.     CreateRGBPalette();
  34.  
  35.     // create a rendering context and make it current
  36.     hrc = wglCreateContext(m_pDC->GetSafeHdc());
  37.     wglMakeCurrent(m_pDC->GetSafeHdc(), hrc);
  38.  
  39. Any help would be greatly appreciated.
  40. clp@alumni.cse.ucsc.edu
  41.